3.639 \(\int (a+b \cos (e+f x)) (A+B \cos (e+f x)) (c \sec (e+f x))^m \, dx\)

Optimal. Leaf size=217 \[ -\frac {c^3 \sin (e+f x) (a A (2-m)+b B (1-m)) (c \sec (e+f x))^{m-3} \, _2F_1\left (\frac {1}{2},\frac {3-m}{2};\frac {5-m}{2};\cos ^2(e+f x)\right )}{f (1-m) (3-m) \sqrt {\sin ^2(e+f x)}}-\frac {c^2 (a B+A b) \sin (e+f x) (c \sec (e+f x))^{m-2} \, _2F_1\left (\frac {1}{2},\frac {2-m}{2};\frac {4-m}{2};\cos ^2(e+f x)\right )}{f (2-m) \sqrt {\sin ^2(e+f x)}}-\frac {a A c^2 \tan (e+f x) (c \sec (e+f x))^{m-2}}{f (1-m)} \]

[Out]

-c^3*(b*B*(1-m)+a*A*(2-m))*hypergeom([1/2, 3/2-1/2*m],[5/2-1/2*m],cos(f*x+e)^2)*(c*sec(f*x+e))^(-3+m)*sin(f*x+
e)/f/(m^2-4*m+3)/(sin(f*x+e)^2)^(1/2)-(A*b+B*a)*c^2*hypergeom([1/2, 1-1/2*m],[2-1/2*m],cos(f*x+e)^2)*(c*sec(f*
x+e))^(-2+m)*sin(f*x+e)/f/(2-m)/(sin(f*x+e)^2)^(1/2)-a*A*c^2*(c*sec(f*x+e))^(-2+m)*tan(f*x+e)/f/(1-m)

________________________________________________________________________________________

Rubi [A]  time = 0.36, antiderivative size = 217, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {2960, 3997, 3787, 3772, 2643} \[ -\frac {c^3 \sin (e+f x) (a A (2-m)+b B (1-m)) (c \sec (e+f x))^{m-3} \, _2F_1\left (\frac {1}{2},\frac {3-m}{2};\frac {5-m}{2};\cos ^2(e+f x)\right )}{f (1-m) (3-m) \sqrt {\sin ^2(e+f x)}}-\frac {c^2 (a B+A b) \sin (e+f x) (c \sec (e+f x))^{m-2} \, _2F_1\left (\frac {1}{2},\frac {2-m}{2};\frac {4-m}{2};\cos ^2(e+f x)\right )}{f (2-m) \sqrt {\sin ^2(e+f x)}}-\frac {a A c^2 \tan (e+f x) (c \sec (e+f x))^{m-2}}{f (1-m)} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Cos[e + f*x])*(A + B*Cos[e + f*x])*(c*Sec[e + f*x])^m,x]

[Out]

-((c^3*(b*B*(1 - m) + a*A*(2 - m))*Hypergeometric2F1[1/2, (3 - m)/2, (5 - m)/2, Cos[e + f*x]^2]*(c*Sec[e + f*x
])^(-3 + m)*Sin[e + f*x])/(f*(1 - m)*(3 - m)*Sqrt[Sin[e + f*x]^2])) - ((A*b + a*B)*c^2*Hypergeometric2F1[1/2,
(2 - m)/2, (4 - m)/2, Cos[e + f*x]^2]*(c*Sec[e + f*x])^(-2 + m)*Sin[e + f*x])/(f*(2 - m)*Sqrt[Sin[e + f*x]^2])
 - (a*A*c^2*(c*Sec[e + f*x])^(-2 + m)*Tan[e + f*x])/(f*(1 - m))

Rule 2643

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(Cos[c + d*x]*(b*Sin[c + d*x])^(n + 1)*Hypergeomet
ric2F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2])/(b*d*(n + 1)*Sqrt[Cos[c + d*x]^2]), x] /; FreeQ[{b, c, d, n
}, x] &&  !IntegerQ[2*n]

Rule 2960

Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*sin[(e_.
) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[g^(m + n), Int[(g*Csc[e + f*x])^(p - m - n)*(b + a*Csc[e + f*x])^m*(
d + c*Csc[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, g, p}, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[p] && I
ntegerQ[m] && IntegerQ[n]

Rule 3772

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(b*Csc[c + d*x])^(n - 1)*((Sin[c + d*x]/b)^(n - 1)
*Int[1/(Sin[c + d*x]/b)^n, x]), x] /; FreeQ[{b, c, d, n}, x] &&  !IntegerQ[n]

Rule 3787

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[a, Int[(d*
Csc[e + f*x])^n, x], x] + Dist[b/d, Int[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]

Rule 3997

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))*(csc[(e_.) + (f_.)*(x_)]*(B_.
) + (A_)), x_Symbol] :> -Simp[(b*B*Cot[e + f*x]*(d*Csc[e + f*x])^n)/(f*(n + 1)), x] + Dist[1/(n + 1), Int[(d*C
sc[e + f*x])^n*Simp[A*a*(n + 1) + B*b*n + (A*b + B*a)*(n + 1)*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f
, A, B}, x] && NeQ[A*b - a*B, 0] &&  !LeQ[n, -1]

Rubi steps

\begin {align*} \int (a+b \cos (e+f x)) (A+B \cos (e+f x)) (c \sec (e+f x))^m \, dx &=c^2 \int (c \sec (e+f x))^{-2+m} (b+a \sec (e+f x)) (B+A \sec (e+f x)) \, dx\\ &=-\frac {a A c^2 (c \sec (e+f x))^{-2+m} \tan (e+f x)}{f (1-m)}-\frac {c^2 \int (c \sec (e+f x))^{-2+m} (-b B (1-m)-a A (2-m)-(A b+a B) (1-m) \sec (e+f x)) \, dx}{1-m}\\ &=-\frac {a A c^2 (c \sec (e+f x))^{-2+m} \tan (e+f x)}{f (1-m)}+((A b+a B) c) \int (c \sec (e+f x))^{-1+m} \, dx+\frac {\left (c^2 (b B (1-m)+a A (2-m))\right ) \int (c \sec (e+f x))^{-2+m} \, dx}{1-m}\\ &=-\frac {a A c^2 (c \sec (e+f x))^{-2+m} \tan (e+f x)}{f (1-m)}+\left ((A b+a B) c \left (\frac {\cos (e+f x)}{c}\right )^m (c \sec (e+f x))^m\right ) \int \left (\frac {\cos (e+f x)}{c}\right )^{1-m} \, dx+\frac {\left (c^2 (b B (1-m)+a A (2-m)) \left (\frac {\cos (e+f x)}{c}\right )^m (c \sec (e+f x))^m\right ) \int \left (\frac {\cos (e+f x)}{c}\right )^{2-m} \, dx}{1-m}\\ &=-\frac {(A b+a B) \cos ^2(e+f x) \, _2F_1\left (\frac {1}{2},\frac {2-m}{2};\frac {4-m}{2};\cos ^2(e+f x)\right ) (c \sec (e+f x))^m \sin (e+f x)}{f (2-m) \sqrt {\sin ^2(e+f x)}}-\frac {(b B (1-m)+a A (2-m)) \cos ^3(e+f x) \, _2F_1\left (\frac {1}{2},\frac {3-m}{2};\frac {5-m}{2};\cos ^2(e+f x)\right ) (c \sec (e+f x))^m \sin (e+f x)}{f (1-m) (3-m) \sqrt {\sin ^2(e+f x)}}-\frac {a A c^2 (c \sec (e+f x))^{-2+m} \tan (e+f x)}{f (1-m)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.38, size = 163, normalized size = 0.75 \[ \frac {\sqrt {-\tan ^2(e+f x)} \cot (e+f x) (c \sec (e+f x))^m \left ((m-2) \left (m (a B+A b) \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {m-1}{2};\frac {m+1}{2};\sec ^2(e+f x)\right )+a A (m-1) \, _2F_1\left (\frac {1}{2},\frac {m}{2};\frac {m+2}{2};\sec ^2(e+f x)\right )\right )+b B (m-1) m \cos ^2(e+f x) \, _2F_1\left (\frac {1}{2},\frac {m-2}{2};\frac {m}{2};\sec ^2(e+f x)\right )\right )}{f (m-2) (m-1) m} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Cos[e + f*x])*(A + B*Cos[e + f*x])*(c*Sec[e + f*x])^m,x]

[Out]

(Cot[e + f*x]*(b*B*(-1 + m)*m*Cos[e + f*x]^2*Hypergeometric2F1[1/2, (-2 + m)/2, m/2, Sec[e + f*x]^2] + (-2 + m
)*((A*b + a*B)*m*Cos[e + f*x]*Hypergeometric2F1[1/2, (-1 + m)/2, (1 + m)/2, Sec[e + f*x]^2] + a*A*(-1 + m)*Hyp
ergeometric2F1[1/2, m/2, (2 + m)/2, Sec[e + f*x]^2]))*(c*Sec[e + f*x])^m*Sqrt[-Tan[e + f*x]^2])/(f*(-2 + m)*(-
1 + m)*m)

________________________________________________________________________________________

fricas [F]  time = 0.46, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (B b \cos \left (f x + e\right )^{2} + A a + {\left (B a + A b\right )} \cos \left (f x + e\right )\right )} \left (c \sec \left (f x + e\right )\right )^{m}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(f*x+e))*(A+B*cos(f*x+e))*(c*sec(f*x+e))^m,x, algorithm="fricas")

[Out]

integral((B*b*cos(f*x + e)^2 + A*a + (B*a + A*b)*cos(f*x + e))*(c*sec(f*x + e))^m, x)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \cos \left (f x + e\right ) + A\right )} {\left (b \cos \left (f x + e\right ) + a\right )} \left (c \sec \left (f x + e\right )\right )^{m}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(f*x+e))*(A+B*cos(f*x+e))*(c*sec(f*x+e))^m,x, algorithm="giac")

[Out]

integrate((B*cos(f*x + e) + A)*(b*cos(f*x + e) + a)*(c*sec(f*x + e))^m, x)

________________________________________________________________________________________

maple [F]  time = 1.94, size = 0, normalized size = 0.00 \[ \int \left (a +b \cos \left (f x +e \right )\right ) \left (A +B \cos \left (f x +e \right )\right ) \left (c \sec \left (f x +e \right )\right )^{m}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*cos(f*x+e))*(A+B*cos(f*x+e))*(c*sec(f*x+e))^m,x)

[Out]

int((a+b*cos(f*x+e))*(A+B*cos(f*x+e))*(c*sec(f*x+e))^m,x)

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \cos \left (f x + e\right ) + A\right )} {\left (b \cos \left (f x + e\right ) + a\right )} \left (c \sec \left (f x + e\right )\right )^{m}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(f*x+e))*(A+B*cos(f*x+e))*(c*sec(f*x+e))^m,x, algorithm="maxima")

[Out]

integrate((B*cos(f*x + e) + A)*(b*cos(f*x + e) + a)*(c*sec(f*x + e))^m, x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.00 \[ \int {\left (\frac {c}{\cos \left (e+f\,x\right )}\right )}^m\,\left (A+B\,\cos \left (e+f\,x\right )\right )\,\left (a+b\,\cos \left (e+f\,x\right )\right ) \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c/cos(e + f*x))^m*(A + B*cos(e + f*x))*(a + b*cos(e + f*x)),x)

[Out]

int((c/cos(e + f*x))^m*(A + B*cos(e + f*x))*(a + b*cos(e + f*x)), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (c \sec {\left (e + f x \right )}\right )^{m} \left (A + B \cos {\left (e + f x \right )}\right ) \left (a + b \cos {\left (e + f x \right )}\right )\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(f*x+e))*(A+B*cos(f*x+e))*(c*sec(f*x+e))**m,x)

[Out]

Integral((c*sec(e + f*x))**m*(A + B*cos(e + f*x))*(a + b*cos(e + f*x)), x)

________________________________________________________________________________________